<?xml version="1.0" encoding="iso-8859-1" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content=
    "application/xhtml+xml; charset=iso-8859-1" />
    <title>
      elogind-243.7
    </title>
    <link rel="stylesheet" type="text/css" href="../stylesheets/lfs.css" />
    <meta name="generator" content="DocBook XSL Stylesheets V1.78.1" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type=
    "text/css" media="print" />
  </head>
  <body class="blfs" id="blfs-2020-04-02">
    <div class="navheader">
      <h4>
        Beyond Linux<sup>�</sup> From Scratch <span class="phrase">(System
        V</span> Edition) - Version 2020-04-02
      </h4>
      <h3>
        Chapter&nbsp;12.&nbsp;System Utilities
      </h3>
      <ul>
        <li class="prev">
          <a accesskey="p" href="dbus.html" title="dbus-1.12.16">Prev</a>
          <p>
            dbus-1.12.16
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="blocaled.html" title="blocaled-0.2">Next</a>
          <p>
            blocaled-0.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
    <div class="sect1" lang="en" xml:lang="en">
      <h1 class="sect1">
        <a id="elogind" name="elogind"></a>elogind-243.7
      </h1>
      <div class="package" lang="en" xml:lang="en">
        <h2 class="sect2">
          Introduction to elogind
        </h2>
        <p>
          <span class="application">elogind</span> is the <span class=
          "application">systemd</span> project's "logind", extracted out to
          be a standalone daemon. It integrates with <a class="xref" href=
          "../postlfs/linux-pam.html" title=
          "Linux-PAM-1.3.1">Linux-PAM-1.3.1</a> to know the set of users that
          are logged in to a system and whether they are logged in
          graphically, on the console, or remotely. <span class=
          "application">Elogind</span> exposes this information via the
          standard org.freedesktop.login1 <span class=
          "application">D-Bus</span> interface, as well as through the file
          system using systemd's standard <code class=
          "filename">/run/systemd</code> layout.
        </p>
        <p>
          This package is known to build and work properly using an LFS-9.1
          platform.
        </p>
        <h3>
          Package Information
        </h3>
        <div class="itemizedlist">
          <ul class="compact">
            <li class="listitem">
              <p>
                Download (HTTP): <a class="ulink" href=
                "https://github.com/elogind/elogind/archive/v243.7/elogind-243.7.tar.gz">
                https://github.com/elogind/elogind/archive/v243.7/elogind-243.7.tar.gz</a>
              </p>
            </li>
            <li class="listitem">
              <p>
                Download MD5 sum: e635fb5ae931685fc8dc61c27d4fb619
              </p>
            </li>
            <li class="listitem">
              <p>
                Download size: 1.3 MB
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated disk space required: 58 MB (add 1.5 MB for tests)
              </p>
            </li>
            <li class="listitem">
              <p>
                Estimated build time: 0.4 SBU (at -j1)
              </p>
            </li>
          </ul>
        </div>
        <h3>
          elogind Dependencies
        </h3>
        <h4>
          Required
        </h4>
        <p class="required">
          <a class="xref" href="dbus.html" title=
          "dbus-1.12.16">dbus-1.12.16</a>
        </p>
        <h4>
          Recommended
        </h4>
        <p class="recommended">
          <a class="xref" href="../pst/docbook.html" title=
          "docbook-xml-4.5">docbook-xml-4.5</a>, <a class="xref" href=
          "../pst/docbook-xsl.html" title=
          "docbook-xsl-nons-1.79.2">docbook-xsl-1.79.2</a>, and <a class=
          "xref" href="libxslt.html" title=
          "libxslt-1.1.34">libxslt-1.1.34</a> (to build the man pages),
          <a class="xref" href="../postlfs/linux-pam.html" title=
          "Linux-PAM-1.3.1">Linux-PAM-1.3.1</a>, and <a class="xref" href=
          "../postlfs/polkit.html" title="Polkit-0.116">Polkit-0.116</a>
          (runtime)
        </p>
        <h4>
          Optional
        </h4>
        <p class="optional">
          For the tests: <a class="xref" href="python-modules.html#lxml"
          title="lxml-4.5.0">lxml-4.5.0</a>, <a class="xref" href=
          "gobject-introspection.html" title=
          "gobject-introspection-1.64.0">gobject-introspection-1.64.0</a>,
          <a class="xref" href="../postlfs/zsh.html" title=
          "zsh-5.8">zsh-5.8</a>, <a class="xref" href="valgrind.html" title=
          "Valgrind-3.15.0">Valgrind-3.15.0</a>, <a class="ulink" href=
          "https://github.com/linux-audit/audit-userspace">audit-userspace</a>,
          <a class="ulink" href=
          "https://github.com/scop/bash-completion">bash-completion</a>,
          <a class="ulink" href=
          "https://mirrors.edge.kernel.org/pub/linux/utils/kernel/kexec/">kexec</a>,
          and <a class="ulink" href=
          "http://www.selinuxproject.org/page/Main_Page">SELinux</a>
        </p>
        <p class="usernotes">
          User Notes: <a class="ulink" href=
          "http://wiki.linuxfromscratch.org/blfs/wiki/elogind">http://wiki.linuxfromscratch.org/blfs/wiki/elogind</a>
        </p>
      </div>
      <div class="kernel" lang="en" xml:lang="en">
        <h2 class="sect2">
          <a id="elogind-kernel" name="elogind-kernel"></a>Kernel
          Configuration
        </h2>
        <p>
          Enable the following options in the kernel configuration and
          recompile the kernel if necessary:
        </p>
        <pre class="screen">
<code class="literal">General setup ---&gt;
    [*]     Control Group support                        [CONFIG_CGROUPS]
File systems ---&gt;
    [*]     Inotify support for userspace                [CONFIG_INOTIFY_USER]
            Pseudo filesystems ---&gt;
                [*]    Tmpfs POSIX Access Control Lists  [CONFIG_TMPFS_POSIX_ACL]</code>
</pre>
        <p>
          In addition, some tests need the userspace cryptographic kernel
          API, which is enabled with:
        </p>
        <pre class="screen">
<code class=
"literal">-*- Cryptographic API ---&gt;                               [CONFIG_CRYPTO]
   &lt;M/*&gt; Userspace cryptographic algorithm configuration [CONFIG_CRYPTO_USER]
   &lt;M/*&gt; User-space interface for hash algorithms        [CONFIG_CRYPTO_USER_API_HASH]</code>
</pre>
      </div>
      <div class="installation" lang="en" xml:lang="en">
        <h2 class="sect2">
          Installation of elogind
        </h2>
        <p>
          Install <span class="application">elogind</span> by running the
          following commands:
        </p>
        <pre class="userinput">
<kbd class="command">mkdir build &amp;&amp;
cd    build &amp;&amp;

meson --prefix=/usr                        \
      --sysconfdir=/etc                    \
      --localstatedir=/var                 \
      -Dcgroup-controller=elogind          \
      -Ddbuspolicydir=/etc/dbus-1/system.d \
      -Dman=auto                           \
      ..  &amp;&amp;
ninja</kbd>
</pre>
        <p>
          To test the results, issue: <span class="command"><strong>ninja
          test</strong></span>. A few tests are skipped if not run with
          <code class="systemitem">root</code> privileges.
        </p>
        <p>
          Now, as the <code class="systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">ninja install                                           &amp;&amp;
ln -sfv  libelogind.pc /usr/lib/pkgconfig/libsystemd.pc &amp;&amp;
ln -sfvn elogind /usr/include/systemd</kbd>
</pre>
      </div>
      <div class="commands" lang="en" xml:lang="en">
        <h2 class="sect2">
          Command Explanations
        </h2>
        <p>
          <em class=
          "parameter"><code>-Dcgroup-controller=elogind</code></em>: This
          switch ensures that <span class="application">elogind</span> is
          selected as the cgroup controller, even if booted with another
          running cgroup controller.
        </p>
        <p>
          <em class=
          "parameter"><code>-Ddbuspolicydir=/etc/dbus-1/system.d</code></em>:
          This switch sets the location of the <span class=
          "application">D-Bus</span> policy directory.
        </p>
        <p>
          <em class="parameter"><code>-Dman=auto</code></em>: The default
          value of this switch is <span class=
          "emphasis"><em>false</em></span>. Setting it to <span class=
          "emphasis"><em>auto</em></span> allows building and installing the
          man pages if the recommended dependencies are installed.
        </p>
        <p>
          <span class="command"><strong>ln -s ...</strong></span>: These
          commands install symlinks so that software packages find systemd
          compatible library and headers.
        </p>
      </div>
      <div class="configuration" lang="en" xml:lang="en">
        <h2 class="sect2">
          Configuring elogind
        </h2>
        <p>
          Each user will need to register a user session using <span class=
          "application">Linux-PAM</span> at login. The <code class=
          "filename">/etc/pam.d/system-session</code> file needs to be
          modified and a new file needs to be created in order for
          <span class="command"><strong>elogind</strong></span> to work
          correctly. Run the following commands as the <code class=
          "systemitem">root</code> user:
        </p>
        <pre class="root">
<kbd class=
"command">cat &gt;&gt; /etc/pam.d/system-session &lt;&lt; "EOF" &amp;&amp;
<code class="literal"># Begin elogind addition
    
session  required    pam_loginuid.so
session  optional    pam_elogind.so

# End elogind addition</code>
EOF
cat &gt; /etc/pam.d/elogind-user &lt;&lt; "EOF"
<code class="literal"># Begin /etc/pam.d/elogind-user

account  required    pam_access.so
account  include     system-account

session  required    pam_env.so
session  required    pam_limits.so
session  required    pam_unix.so
session  required    pam_loginuid.so
session  optional    pam_keyinit.so force revoke
session  optional    pam_elogind.so

auth     required    pam_deny.so
password required    pam_deny.so

# End /etc/pam.d/elogind-user</code>
EOF</kbd>
</pre>
      </div>
      <div class="content" lang="en" xml:lang="en">
        <h2 class="sect2">
          Contents
        </h2>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong class="segtitle">Installed Programs:</strong>
              <span class="segbody">busctl, elogind-inhibit, and
              loginctl</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Library:</strong>
              <span class="segbody">libelogind.so</span>
            </div>
            <div class="seg">
              <strong class="segtitle">Installed Directories:</strong>
              <span class="segbody">/lib/elogind, /etc/elogind,
              /usr/include/elogind, and /usr/share/doc/elogind-243.7</span>
            </div>
          </div>
        </div>
        <div class="variablelist">
          <h3>
            Short Descriptions
          </h3>
          <table border="0" class="variablelist">
            <colgroup>
              <col align="left" valign="top" />
              <col />
            </colgroup>
            <tbody>
              <tr>
                <td>
                  <p>
                    <a id="busctl" name="busctl"></a><span class=
                    "term"><span class=
                    "command"><strong>busctl</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is used to introspect and monitor the D-Bus bus.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="elogind-inhibit" name=
                    "elogind-inhibit"></a><span class="term"><span class=
                    "command"><strong>elogind-inhibit</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is used to execute a program with a shutdown, sleep or
                    idle inhibitor lock taken.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="loginctl" name="loginctl"></a><span class=
                    "term"><span class=
                    "command"><strong>loginctl</strong></span></span>
                  </p>
                </td>
                <td>
                  <p>
                    is used to introspect and control the state of the
                    elogind Login Manager.
                  </p>
                </td>
              </tr>
              <tr>
                <td>
                  <p>
                    <a id="libelogind" name="libelogind"></a><span class=
                    "term"><code class="filename">libelogind.so</code></span>
                  </p>
                </td>
                <td>
                  <p>
                    is the main elogind utility library.
                  </p>
                </td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <p class="updated">
        Last updated on 2020-03-12 15:57:03 -0500
      </p>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="dbus.html" title="dbus-1.12.16">Prev</a>
          <p>
            dbus-1.12.16
          </p>
        </li>
        <li class="next">
          <a accesskey="n" href="blocaled.html" title="blocaled-0.2">Next</a>
          <p>
            blocaled-0.2
          </p>
        </li>
        <li class="up">
          <a accesskey="u" href="sysutils.html" title=
          "Chapter&nbsp;12.&nbsp;System Utilities">Up</a>
        </li>
        <li class="home">
          <a accesskey="h" href="../index.html" title=
          "Beyond Linux� From Scratch     (System V Edition) - Version 2020-04-02">
          Home</a>
        </li>
      </ul>
    </div>
  </body>
</html>
